<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件监听器示例</title>
    <style>
        #myButton {
            width: 150px;
            height: 50px;
            background-color: lightblue;
        }
    </style>
</head>
<body>
<button id="myButton">悬停在我上面</button>

<script>
    // 获取按钮元素
    let button = document.getElementById("myButton");

    // 添加鼠标悬停事件监听器
    button.addEventListener("mouseover", function () {
        button.style.backgroundColor = "orange";
    });

    // 添加鼠标移开事件监听器
    button.addEventListener("mouseout", function () {
        button.style.backgroundColor = "lightblue";
    });
</script>
</body>
</html>